package VN.EDU.IMIC.DEVELOPER.DOMINHNGOC;

public class DemoArrayModel {
	int[] list = new int[10];
	int tong, max, min;
	int k=0;
	
	public void inputArray(int so){
	
		list[k]=so;
		k++;
	}
	public int tinhTong(){
		for(int i =0; i<list.length; i++){
			tong = tong+ list[i];
		}
		return tong;
	}
	public void hienThi(){
		for(int i=0;i<list.length; i++){
			System.out.println("Phần tử thứ "+ (i+1) +" là "+ list[i] );
		}
	}
	public int soLonNhat(){
		for (int i = 0; i < list.length; i++) {
			if (max<list[i]) {
				max=list[i];
			}
		}
		return max;
	}
	public int soNhoNhat(){
		
		for (int i = 0; i < list.length; i++) {
			if (min>list[i]) {
				min=list[i];
			}
		}
		return min;
	}
	
	
}
